package com.woniuxy.service.daily.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.dao.RepairsMapper;
import com.woniuxy.pojo.Driver;
import com.woniuxy.pojo.Repairs;
import com.woniuxy.service.daily.RepairsService;

@Service
public class RepairsServiceImpl implements RepairsService{
	@Autowired
	private RepairsMapper RepairsMapper;

	@Override
	public PageInfo selectAll(Integer dr_pn, String dr_condition) {
		// TODO Auto-generated method stub
		PageHelper.startPage(dr_pn, 5);
		List<Repairs> list = RepairsMapper.selectAll(dr_condition);
		PageInfo pageInfo = new PageInfo(list,3);
		return pageInfo;
	}

	@Override
	public void addRepairs(Repairs repairs) {
		// TODO Auto-generated method stub
		RepairsMapper.insertSelective(repairs);
	}

	@Override
	public Repairs selectByPrimaryKey(Integer rpId) {
		// TODO Auto-generated method stub
		return RepairsMapper.selectByPrimaryKey(rpId);
	}

	@Override
	public int updateByPrimaryKeySelective(Repairs record) {
		// TODO Auto-generated method stub
		return RepairsMapper.updateByPrimaryKeySelective(record);

	}

	@Override
	public void deleteByPrimaryKey(Integer rpId) {
		// TODO Auto-generated method stub
		RepairsMapper.deleteByPrimaryKey(rpId);
	}

	@Override
	public int batchDelete(Integer[] cb) {
		System.out.println("CBCBCB"+cb);
		// TODO Auto-generated method stub
		return RepairsMapper.batchDelete(cb);
	}

	
	
	
}
